Skip to content

Timeline.Actions: wrap below Body on narrow viewports#8169

Open
liuliu-dev wants to merge 8 commits into
mainfrom
timeline-actions-responsive-narrow
Open

Timeline.Actions: wrap below Body on narrow viewports#8169
liuliu-dev wants to merge 8 commits into
mainfrom
timeline-actions-responsive-narrow

Conversation

@liuliu-dev

@liuliu-dev liuliu-dev commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Closes github/primer#6693

When Timeline.Item is below 480px inline size, it now switches to a two-row grid so Timeline.Actions wraps onto its own line under Timeline.Body, left-aligned with the body content. Above 480px is unchanged.

Uses a container query on .Timeline, so the wrap responds to the timeline's own width — narrow side panels and split views work correctly without depending on viewport size.

Changelog

New

  • Narrow-viewport wrap for Timeline.Actions (< 480px).
  • WithActions story: commit-SHA rows hide the Verified /Unverified label at narrow widths, and the cross-reference card
    stacks vertically.

Rollout strategy

  • Patch release

Testing & Reviewing

Add three dev stories under Components/Timeline/Dev/Actions Responsive
that explore layout options for Timeline.Actions when the surrounding
Timeline.Item is below 480px inline size, tracked in github/primer#6693:

  1. Wrap below Body — Item switches to a 2-column grid so Actions land
     in the same column as Body, left-aligned with the body text.
  2. Stack vertically — Actions become a right-aligned column with an
     enforced 8px gap from Body.
  3. Baseline — current inline behavior, kept for side-by-side comparison.

Each story uses a container-query-driven layout inside a resizable wrapper
so Storybook viewport controls (or the drag handle) can drive the
transition. No production Timeline code is touched.
@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ee9b894

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

The initial commit used *.dev.stories.* which is excluded from the
deployed Storybook build (packages/react/.storybook/main.ts). Rename to
*.features.stories.* and move the story title from
'Components/Timeline/Dev/Actions Responsive' to
'Components/Timeline/Features/Actions Responsive' so reviewers can open
the three prototypes on the PR preview URL.
Adds two cases to the shared ItemCases block so each responsive option
also demonstrates layouts where Timeline.Actions holds a verification
cluster (Label + icon + SHA link) rather than buttons \u2014 the pattern
used on PR commit-added events (github/primer#6693).

  E. Long commit subject (\u201cApply suggestions from code review\u201d) +
     Verified label + check icon + SHA.
  F. Same shape with a \u201cPartially verified\u201d label + X icon + SHA to
     stress the SHA cluster with a wider Actions slot.

Adds .SignatureLabelPartial and .IconDanger helper classes for the
partially-verified variant styling.
Adds Case G to ItemCases so each responsive option also demonstrates the
third Timeline.Actions pattern Jan called out alongside Buttons and SHA
clusters (github/primer#6693): an optional octicon (LockIcon for private
references) paired with a StateLabel showing the referenced PR's state.

Mirrors the GitHub PR cross-reference row ("mentioned this pull request
in <PR title> #NNNN") with LockIcon + StateLabel status=pullOpened as
Actions content. Confirms the grid switch in Option 1 also aligns the
StateLabel cluster under the reference text at narrow widths.
@github-actions
github-actions Bot requested a deployment to storybook-preview-8169 July 16, 2026 16:50 Abandoned
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8169 July 16, 2026 17:00 Inactive
@liuliu-dev liuliu-dev added the Canary Release Apply this label when you want CI to create a canary release of the current PR label Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. If this doesn't work, you can also use the original workflow here. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

@github-actions github-actions Bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jul 16, 2026
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8169 July 16, 2026 18:36 Inactive
@liuliu-dev
liuliu-dev marked this pull request as ready for review July 16, 2026 20:02
@liuliu-dev
liuliu-dev requested a review from a team as a code owner July 16, 2026 20:02
@liuliu-dev
liuliu-dev requested review from Copilot and llastflowers and removed request for Copilot July 16, 2026 20:02
@github-actions
github-actions Bot temporarily deployed to storybook-preview-8169 July 16, 2026 20:10 Inactive

@janmaarten-a11y janmaarten-a11y left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me. ❤️

I double-checked my recent github-ui PRs that aim to add proper list semantics to events and found no major conflicts.

The one possible interaction to watch is is that #26232's .Timeline_Item_withDivider explicitly relies on Timeline.Item being a flex row it can wrap so the full-width divider spans correctly (its own comment says so). If a divider row ever renders inside a Timeline narrower than 480px with the semantics flag on, #8169's grid could override that flex assumption and the divider could reflow. It only bites at <480px container width with both changes active and the flag on, so production (flag off) is unaffected.

Not something to worry about in this PR, I think. Once this one lands, I'll check to see if any updates are needed to that one.

@liuliu-dev liuliu-dev changed the title Timeline.Actions: narrow-viewport layout options Timeline.Actions: wrap below Body on narrow viewports Jul 16, 2026
@primer-integration

Copy link
Copy Markdown

Integration test results from github/github-ui PR:

Passed  CI   Passed
Failed  VRT   Failed
Passed  Projects   Passed

VRT check ensures that when visual differences are detected, the PR cannot proceed until someone acknowledges the changes by adding the "visual difference acknowledged" label.

Need help? If you believe this failure is unrelated to your changes, please reach out to the Primer team for assistance.

Copilot AI review requested due to automatic review settings July 16, 2026 22:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@liuliu-dev liuliu-dev added Canary Release Apply this label when you want CI to create a canary release of the current PR and removed Canary Release Apply this label when you want CI to create a canary release of the current PR labels Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Canary Release Apply this label when you want CI to create a canary release of the current PR integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants